<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <script type="application/javascript" src="js/jquery-3.5.1.js"></script>
</head>
<body>

<form method="get">
    用户名：<input id="email" type="text" name="email"/><br/>
    密码： <input id="password" type="password" name="password"/><br/>
    <input type="button" value="登录" onclick="login()"/><br/>
    <a href="register.html">注册新账号</a>
</form>


</body>
<script type="application/javascript">

    /**
     *登录
     */
    function login() {
        $.get("/api/user/login/" + $('#email').val() + "/" + $('#password').val(), function (data) {
            if (data.flag) {
                window.location.href = "welcome.html";
            } else {
                alert(data.msg);
            }
        });
    }

</script>
</html>